<?php
class TmpInbound_Form_TmpInbound_Search extends ZendX_JQuery_Form
{
	public function __construct(Zend_Controller_Action $controller)
	{
		//inbound_code
		$inbound_code=$this->createElement ( 'text', 'inbound_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('inbound_code' ))
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_code' ))
		;
		
		//inbound_type
		$inbound_type=$this->createElement ( 'text', 'inbound_type' )
		->setLabel ( $controller->getHelper('common')->getCaption('inbound_type' ))
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_type' ))
		->addValidator ( 'Int' )
		->setAttrib ( 'class','numeric' )
		;
		
		//inbound_note
		$inbound_note=$this->createElement ( 'textarea', 'inbound_note' )
		->setLabel ( $controller->getHelper('common')->getCaption('inbound_note' ))
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_note' ))
		;
		
		//inbound_company_code
		$inbound_company_code = new ZendX_JQuery_Form_Element_AutoComplete ( 'inbound_company_code' );
		$inbound_company_code
		->setLabel ( $controller->getHelper('common')->getCaption('inbound_company_code' ))
		->setDescription ( 
		"<br/><br/>"
		.$controller->view->partial("index/manage/submit.phtml",'admin',array('value'=>'Tìm kiếm thông tin','onclick'=>"$('#adminForm').submit();")))
		;
		
		//inbound_create_time_a
		$inbound_create_time_a = new Itvina_JQuery_Form_Element_DatePicker ( 'inbound_create_time_a' ,array('jQueryParams' => array('dateFormat' => 'd.m.yy')));
		$inbound_create_time_a
		->setLabel ( "Ngày tạo phiếu từ ngày" )
		->setAttrib('have_check', 1)
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_create_time' ))
		;
		
		//inbound_create_time_b
		$inbound_create_time_b = new Itvina_JQuery_Form_Element_DatePicker ( 'inbound_create_time_b' );
		$inbound_create_time_b
		->setLabel ( "<span style='color:#f4f4f4'>Ngày tạo phiếu</span> đến ngày" )
		->setAttrib('have_check', 1)
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_create_time' ))
		;
		
		//inbound_create_user
		$inbound_create_user=$this->createElement ( 'select', 'inbound_create_user' )
		->setLabel ( $controller->getHelper('common')->getCaption('inbound_create_user' ))
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_create_user' ))
		;
		
		//inbound_warehouse_keep_user
		$inbound_warehouse_keep_user=$this->createElement ( 'text', 'inbound_warehouse_keep_user' )
		->setLabel ( $controller->getHelper('common')->getCaption('inbound_warehouse_keep_user' ))
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_warehouse_keep_user' ))
		;
		
		//inbound_delivery_user
		$inbound_delivery_user=$this->createElement ( 'text', 'inbound_delivery_user' )
		->setLabel ( $controller->getHelper('common')->getCaption('inbound_delivery_user' ))
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_delivery_user' ))
		;
		
		//inbound_reason_code
		$inbound_reason_code=$this->createElement ( 'select', 'inbound_reason_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('inbound_reason_code' ))
		/*->setDescription ( 
		"<br/><br/>"
		.$controller->view->partial("index/manage/submit.phtml",'admin',array('value'=>'Tìm kiếm thông tin','onclick'=>"$('#adminForm').submit();")))*/
		;
		
		//inbound_order_code
		$inbound_order_code=$this->createElement ( 'text', 'inbound_order_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('inbound_order_code' ))
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_order_code' ))
		;
		
		//inbound_warehouse_code
		$inbound_warehouse_code=$this->createElement ( 'select', 'inbound_warehouse_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('inbound_warehouse_code' ))
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_warehouse_code' ))
		;
		
		//inbound_detail_product_code
		$inbound_detail_product_code=$this->createElement ( 'select', 'inbound_detail_product_code' )
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_order_code' ))
		;
		
		//product_group_code
		$product_group_code=$this->createElement ( 'select', 'product_group_code' )
		->setLabel ( 'Nhóm hàng hóa')
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_order_code' ))
		;
		
		//product_group_code
		$inbound_detail_sub_product_code=$this->createElement ( 'select', 'inbound_detail_sub_product_code' )
		->setLabel ( 'Thành phẩm')
		//->setDescription ( $controller->getHelper('common')->getDescription('inbound_order_code' ))
		;
		
		$this->addElements ( array (
			$inbound_code,			
			$inbound_create_time_a,
			$inbound_create_time_b,
			$inbound_create_user,
			$product_group_code,
			$inbound_detail_product_code,			
			$inbound_warehouse_code,			
			$inbound_reason_code,
			$inbound_company_code,
			$inbound_detail_sub_product_code,
		) );	
		
		$controller->getHelper ( 'common' )->form ( $this );
	}
}